<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./AlumnoTemplate.xhtml">
            <ui:define name="top"></ui:define>
            <ui:define name="left"></ui:define>
            <ui:define name="right"></ui:define>

            <ui:define name="content">
                <h:form id="postForm">
                    <p:dataTable var="post" value="#{alumnoActionListener.misPostulaciones}" selectionMode="single"  paginator="true" rows="1">  


                        <p:messages id="msgs" showDetail="true" /> <br></br> 

                        <f:facet name="header">  
                            Mis Postulaciones
                        </f:facet>  


                        <p:column style="width:40px">  

                            <p:commandButton title="View" update="postForm" process="@this"
                                             value="Borrar" action="#{alumnoActionListener.borrarPostulacion}">  
                                <f:setPropertyActionListener value="#{post}" target="#{alumnoActionListener.vacanteSeleccionada}" /> 
                                <p:collector value="#{post}"
                                             removeFrom="#{alumnoActionListener.misPostulaciones}" />
                            </p:commandButton>  

                            <h:outputText value="#{post.htmlDescripcion}" escape="false" />                                                        

                            <f:view contentType="text/html">


                                <br></br>

                                <p:gmap center="#{post.latitud}, #{post.longitud}" zoom="15" 
                                        type="ROADMAP" style="width:600px;height:400px"  widgetVar="map"
                                        mapTypeControl="true" navigationControl="true" 
                                        streetView="false" onPointClick="handlePointClick(event);"
                                        model="#{post.emptyModel}" 
                                        overlaySelectListener="#{post.emptyModel}"
                                        >
                                </p:gmap>


                            </f:view>
                        </p:column>
                    </p:dataTable>  

                    <p:dialog header="Car Detail" widgetVar="exitoDialogo" resizable="false" id="carDlg"  
                              showEffect="fade" hideEffect="explode" modal="true">
                        <h:outputLabel value="Se ha eliminado su postulación exitosamente"/>
                    </p:dialog>
                </h:form>
            </ui:define>

            <ui:define name="bottom"></ui:define>
        </ui:composition>

    </body>
</html>
